<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
 <%@ page import="java.util.*" %>
 <%@ page import="org.json.simple.JSONObject" %>
 <%@ page import="org.json.simple.parser.JSONParser" %>
 <%@ page import="org.json.simple.JSONArray" %>
 <%@ page import="com.netcracker.studportal.server.facade.*" %>
    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<%

String login = null;
String password = null;
//String id = null;
String type = null;
if(request.getParameter("password") != null && request.getParameter("login") != null){
if(request.getParameter("password").equals("") || request.getParameter("login").equals("")) {
out.println("<font color=red>Enter login or password!!!</font>");
} else {
login = request.getParameter("login");
password = request.getParameter("password");
//id = request.getParameter("id");
type = request.getParameter("type");

		FacadeAdmin fa = new FacadeAdmin();

//out.println("addStudent");

		JSONObject obj=new JSONObject();
	//	obj.put("user_id",id);
		obj.put("type",type);
		obj.put("login",login);
		obj.put("password",password);

		String param = obj.toString();
		param = fa.addNewUser(param);
}
}


 %>


<form method="post" action="AddUser.jsp">
			
			<input type="text" name="type"> type <br>
			<input type="text" name="login"> login <br>
			<input type="text" name="password"> password <br>
			<input type="submit" value="Add!">
	</form>	


</body>
</html>